﻿<%@ Page Title="CUPS Manage Properties" Language="vb" AutoEventWireup="false" MasterPageFile="~/Content/Site.Master" CodeBehind="manage_properties.aspx.vb" Inherits="CupsApp.Web.Form.manage_properties" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">




<div class="Content">
  <asp:FormView ID="FormView1" runat="server" DataSourceID="ObjectDataSource2" 
        Width="100%"> 
        <ItemTemplate >
        <b>Landlord:</b><i> <%# Eval("Name") %></i><br />
        <b>Phone No:</b> <i><%# Eval("Phone") %></i><br />
        <b>Company Name:</b> <i><%# Eval("CompanyName") %></i><br />
        <b>Notes:</b> <i><%# Eval("Notes") %></i><br />
        </ItemTemplate>   
  </asp:FormView>

<div class="filler"></div>
    <div class="FullRow1">
        <center> <strong><asp:Label ID="lvlMsg" runat="server" ForeColor="#00CC00" ></asp:Label></strong></center>
    </div> 
   <div class="FullRow1">
     <div class="filler"></div>
     <div class="FormHeading">
         <strong><asp:Label ID="lblBasicInfo" runat="server" Text="NEW PROPERTY"></asp:Label></strong>
    </div>
  </div> 
  <div class="filler"></div>
 
<div class="FullRow1">
    <div class="ContentRow2">
    </div>
    <div class="ContentRow1">
        <asp:Label ID="Label1" runat="server" Text="Address:"></asp:Label>
    </div>
    <div class="ContentRow2">
        <asp:TextBox ID="txtAddress" width = "300px" runat="server"></asp:TextBox>
    </div>
    <div class="ContentRow2">
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ControlToValidate="txtAddress" 
      ErrorMessage="* Required!" Display="Dynamic" /> 
    </div>
</div> 

<div class="FullRow1">
    <div class="ContentRow2">
    </div>
    <div class="ContentRow1">
        <asp:Label ID="Label2" runat="server" Text="City:"></asp:Label>
    </div>
    <div class="ContentRow2">
        <asp:DropDownList ID="ddlCity"
            runat="server" Width = "200px">
             <asp:ListItem Value="0">Please select city</asp:ListItem> 
             <asp:ListItem Value="1">Calgary</asp:ListItem> 
        </asp:DropDownList>
    </div>
    <div class="ContentRow2">
    <asp:RequiredFieldValidator id="rfvCity" runat="server" ControlToValidate="ddlCity" 
    InitialValue="0"  ErrorMessage="* City is Required!" Display="Dynamic" /> 
    </div>
</div> 

<div class="FullRow1">
    <div class="ContentRow2">
    </div>
    <div class="ContentRow1">
        <asp:Label ID="Label5" runat="server" Text="Postal:"></asp:Label>
    </div>
    <div class="ContentRow2">
        <asp:TextBox ID="txtPostal" runat="server" width = "60px" MaxLength="10"></asp:TextBox>  <asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server" ControlToValidate="txtAddress" 
      ErrorMessage="* Required!" Display="Dynamic" /> 
    </div>
    <div class="ContentRow2">
      
    </div>
</div> 

<div class="FullRow1">
    <div class="ContentRow2">
    </div>
    <div class="ContentRow1">
        <asp:Label ID="Label6" runat="server" Text="Suite:"></asp:Label>
    </div>
    <div class="ContentRow2">
        <asp:TextBox ID="txtSuite" runat="server"  width = "60px" MaxLength="10"  ></asp:TextBox>
    </div>
    <div class="ContentRow2">
    </div>
</div> 

<div class="FullRow1">
    <div class="ContentRow2">
    </div>
    <div class="ContentRow1">
        <asp:Label ID="Label7" runat="server" Text="Current Status:"></asp:Label>
    </div>
    <div class="ContentRow2">
        <asp:DropDownList ID="ddlStatus"
            runat="server" DataSourceID="StatusDataSource" Width = "200px" DataTextField="Name" DataValueField="ID" AppendDataBoundItems="True"  >
             <asp:ListItem Value="0">Please select status</asp:ListItem> 
        </asp:DropDownList>
    </div>
    <div class="ContentRow2">
    <asp:RequiredFieldValidator id="Rfv1" runat="server" ControlToValidate="ddlStatus" 
                   InitialValue="0"  ErrorMessage="* Status is Required!" Display="Dynamic" /> 

    </div>
</div>
  <div class="FullRow1">
     <hr/>
     <center><asp:Button ID="btnSave" runat="server" Text="Save" Width="83px" 
             style="height: 26px" />&nbsp;&nbsp;<asp:Button ID="btnBack" runat="server" Text="Back" Width="83px" CausesValidation="false" /></center>
  </div>
    
  <br /><br />

  <div class="FullRow1">
     <div class="FormHeading">
            <strong><asp:Label ID="lblFirstLanguage" runat="server" Text="EXISTING PROPERTIES"></asp:Label></strong>
    </div>
  </div> 
   
  <div class="FullRow2"> 
  <div class="filler"></div><div class="filler"></div>
     <asp:GridView ID="gvProperties" runat="server" AutoGenerateColumns="False" 
          DataSourceID="ObjectDataSource1" AllowPaging="True" AllowSorting="False" width = "99%">
          <RowStyle HorizontalAlign="Left" />
          <Columns>
              <asp:ButtonField ButtonType="Link" Text="Edit" CommandName="Modify" />
              <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID"  />
              <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
              <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
              <asp:BoundField DataField="PostalCode" HeaderText="PostalCode" SortExpression="PostalCode" />
              <asp:BoundField DataField="Suite" HeaderText="Suite" SortExpression="Suite" />
              <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" />
              <asp:BoundField DataField="UpdatedOn" HeaderText="UpdatedOn" 
                  SortExpression="UpdatedOn" />
              <asp:BoundField DataField="UpdatedBy" HeaderText="UpdatedBy" 
                  SortExpression="UpdatedBy" />
              <asp:ButtonField ButtonType="Link" Text="View Property History / Clients" CommandName="Clients" CausesValidation = "False" />
          </Columns>
      
          <HeaderStyle Font-Bold="False" HorizontalAlign="Center" />
          <EditRowStyle HorizontalAlign="Left" />
      
          <AlternatingRowStyle BackColor="#F8F8F8" />
      
      </asp:GridView>
      
  <div class="filler"></div><div class="filler"></div>
  </div>
               

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        SelectMethod="GetPropertiesWithStatus" TypeName="CupsApp.Service.CupsDomainService">
    <SelectParameters>
            <asp:QueryStringParameter Name="LandlordID" QueryStringField="LandlordID" Type="Int32"  />
    </SelectParameters>
</asp:ObjectDataSource>

<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
        SelectMethod="GetLandlord" TypeName="CupsApp.Service.CupsDomainService">
    <SelectParameters>
            <asp:QueryStringParameter Name="LandlordID" QueryStringField="LandlordID" Type="Int32"  />
    </SelectParameters>
</asp:ObjectDataSource>

<asp:ObjectDataSource ID="StatusDataSource" runat="server" 
        SelectMethod="PropertyStatusLandlord" 
        TypeName="CupsApp.Service.CupsDomainService">
</asp:ObjectDataSource>

</asp:Content>

